package collection;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionDemo4 {
    public static void main(String[] args) {
        Collection c=new ArrayList();
        Point p=new Point(1,2);
        c.add(p);//将p变量的值（地址）存入集合中
        System.out.println("p:"+p);
        System.out.println("c:"+c);
        p.setX(10);
        System.out.println("p:"+p);
        System.out.println("c:"+c);
    }
}
